home *** CD-ROM | disk | FTP | other *** search
- /************************************************************
-
- Created: Friday, June 4, 1993 at 10:05AM
- OCEMessaging.h
- C Interface to the Macintosh Libraries
-
- Copyright Apple Computer, Inc. 1990-1993
- All rights reserved
-
- ************************************************************/
-
-
- #ifndef __OCEMESSAGING__
- #define __OCEMESSAGING__
-
- #ifndef __DIGITALSIGNATURE__
- #include <DigitalSignature.h>
- #endif
-
- #ifndef __FILES__
- #include <Files.h>
- #endif
-
- #ifndef __OCE__
- #include <OCE.h>
- #endif
-
- #ifndef __OCEAUTHDIR__
- #include <OCEAuthDir.h>
- #endif
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
-
-
-
- /******************************************************************************/
- /* Definitions common to OCEMessaging and to OCEMail. These relate to addressing,
- message ids and priorities, etc. */
-
-
- /* Values of IPMPriority */
- enum {
- kIPMAnyPriority = 0, /* FOR FILTER ONLY */
- kIPMNormalPriority = 1,
- kIPMLowPriority,
- kIPMHighPriority
- };
-
- typedef Byte IPMPriority;
-
-
- /* Values of IPMAccessMode */
- enum {
- kIPMAtMark,
- kIPMFromStart,
- kIPMFromLEOM,
- kIPMFromMark
- };
-
- typedef unsigned short IPMAccessMode;
-
-
- enum {
- kIPMUpdateMsgBit = 4,
- kIPMNewMsgBit = 5,
- kIPMDeleteMsgBit = 6
- };
-
- /* Values of IPMNotificationType */
- enum {
- kIPMUpdateMsgMask = 1<<kIPMUpdateMsgBit,
- kIPMNewMsgMask = 1<<kIPMNewMsgBit,
- kIPMDeleteMsgMask = 1<<kIPMDeleteMsgBit
- };
-
- typedef Byte IPMNotificationType;
-
-
- /* Values of IPMSenderTag */
- enum {
- kIPMSenderRStringTag,
- kIPMSenderRecordIDTag
- };
-
- typedef unsigned short IPMSenderTag;
-
-
- enum {
- kIPMFromDistListBit = 0,
- kIPMDummyRecBit = 1,
- kIPMFeedbackRecBit = 2, /* should be redirected to feedback queue */
- kIPMReporterRecBit = 3, /* should be redirected to reporter original queue */
- kIPMBCCRecBit = 4 /* this recipient is blind to all recipients of message */
- };
-
- /* Values of OCERecipientOffsetFlags */
- enum {
- kIPMFromDistListMask = 1<<kIPMFromDistListBit,
- kIPMDummyRecMask = 1<<kIPMDummyRecBit,
- kIPMFeedbackRecMask = 1<<kIPMFeedbackRecBit,
- kIPMReporterRecMask = 1<<kIPMReporterRecBit,
- kIPMBCCRecMask = 1<<kIPMBCCRecBit
- };
-
- typedef Byte OCERecipientOffsetFlags;
-
-
- struct OCECreatorType {
- OSType msgCreator;
- OSType msgType;
- };
-
- typedef struct OCECreatorType OCECreatorType;
-
-
-
- #define kIPMTypeWildCard 'ipmw'
-
- #define kIPMFamilyUnspecified 0
- #define kIPMFamilyWildCard 0x3F3F3F3FL
- /* '????' */
-
- /* well known signature */
- #define kIPMSignature 'ipms' /* base type */
-
- /* well known message types */
- #define kIPMReportNotify 'rptn' /* routing feedback */
-
- /* well known message block types */
- #define kIPMEnclosedMsgType 'emsg' /* enclosed (nested) message */
- #define kIPMReportInfo 'rpti' /* recipient information */
- #define kIPMDigitalSignature 'dsig' /* digital signature */
-
- /* Values of IPMMsgFormat */
- enum {
- kIPMOSFormatType = 1,
- kIPMStringFormatType = 2
- };
-
- typedef unsigned short IPMMsgFormat;
-
- typedef Str32 IPMStringMsgType;
-
- struct IPMMsgType {
- IPMMsgFormat format; /* IPMMsgFormat*/
- union{
- OCECreatorType msgOSType;
- IPMStringMsgType msgStrType;
- }theType;
- };
-
- typedef struct IPMMsgType IPMMsgType;
-
-
- /*
- Following are the known extension values for IPM addresses handled by Apple.
- We define the definition of the entn extension below.
- */
-
- enum {
- kOCEalanXtn = 'alan',
- kOCEentnXtn = 'entn', /* entn = entity name (aka DSSpec) */
- kOCEaphnXtn = 'aphn'
- };
-
- /*
- Following are the specific definitions for the extension for the standard
- OCEMail 'entn' addresses. [Note, the actual extension is formatted as in
- IPMEntityNameExtension.]
- */
-
- /* entn extension forms */
- enum {
- kOCEAddrXtn = 'addr',
- kOCEQnamXtn = 'qnam',
- kOCEAttrXtn = 'attr', /* an attribute specification */
- kOCESpAtXtn = 'spat' /* specific attribute */
- };
-
- /*
- Following are the specific definitions for standard
- OCEMail 'aphn' extension value.
-
- All RStrings here are packed (e.g. truncated to length) and even padded (e.g.
- if length odd, then a pad byte (zero) should be introduced before the next field).
-
- The extension value is in the packed form of the following structure:
- RString phoneNumber;
- RString modemType;
- Str32 queueuName;
-
- The body of phoneNumber compound RString is in the packed form of the following structure:
- short subType;
- RString countryCode; // used when subType == kOCEUseHandyDial
- RString areaCode; // used when subType == kOCEUseHandyDial
- RString phone; // used when subType == kOCEUseHandyDial
- RString postFix; // used when subType == kOCEUseHandyDial
- RString nonHandyDialString; // used when subType == kOCEDontUseHandyDial
- */
-
- /* phoneNumber sub type constants */
- enum {
- kOCEUseHandyDial = 1,
- kOCEDontUseHandyDial = 2
- };
-
- /* FORMAT OF A PACKED FORM RECIPIENT */
- #define OCEPackedRecipientHeader \
- unsigned short dataLength;
-
- struct ProtoOCEPackedRecipient {
- OCEPackedRecipientHeader
- };
- typedef struct ProtoOCEPackedRecipient ProtoOCEPackedRecipient;
-
- #define kOCEPackedRecipientMaxBytes (4096 - sizeof(ProtoOCEPackedRecipient))
- struct OCEPackedRecipient {
- OCEPackedRecipientHeader
- Byte data[kOCEPackedRecipientMaxBytes];
- };
- typedef struct OCEPackedRecipient OCEPackedRecipient;
-
-
- struct IPMEntnQueueExtension {
- Str32 queueName;
- };
-
- typedef struct IPMEntnQueueExtension IPMEntnQueueExtension;
-
- struct IPMEntnAttributeExtension { /* kOCEAttrXtn */
- AttributeType attributeName;
- };
-
- typedef struct IPMEntnAttributeExtension IPMEntnAttributeExtension;
-
- struct IPMEntnSpecificAttributeExtension { /* kOCESpAtXtn */
- AttributeCreationID attributeCreationID;
- AttributeType attributeName;
- };
-
- typedef struct IPMEntnSpecificAttributeExtension IPMEntnSpecificAttributeExtension;
-
- /* All IPM entn extensions fit within the following */
-
- struct IPMEntityNameExtension {
- OSType subExtensionType;
- union {
- IPMEntnSpecificAttributeExtension specificAttribute;
- IPMEntnAttributeExtension attribute;
- IPMEntnQueueExtension queue;
- } u;
- };
-
- typedef struct IPMEntityNameExtension IPMEntityNameExtension;
-
- /* addresses with kIPMNBPXtn should specify this nbp type */
- #define kIPMWSReceiverNBPType "\pMsgReceiver"
-
-
-
-
- struct IPMMsgID {
- unsigned long id[4];
- };
-
- typedef struct IPMMsgID IPMMsgID;
-
-
- /* Values of IPMHeaderSelector */
- enum {
- kIPMTOC = 0,
- kIPMSender = 1,
- kIPMProcessHint = 2,
- kIPMMessageTitle = 3,
- kIPMMessageType = 4,
- kIPMFixedInfo = 7
- };
-
- typedef Byte IPMHeaderSelector;
-
- struct IPMSender {
- IPMSenderTag sendTag;
- union{
- RString rString;
- PackedRecordID rid;
- }theSender;
- };
- typedef struct IPMSender IPMSender;
-
- typedef DSSpec OCERecipient;
-
-
-
-
-
- /******************************************************************************/
- /* Definitions specific to OCEMessaging */
-
- typedef unsigned long IPMContextRef;
- typedef unsigned long IPMQueueRef;
- typedef unsigned long IPMMsgRef;
- typedef unsigned long IPMSeqNum;
- typedef Str32 IPMProcHint;
- typedef Str32 IPMQueueName;
-
-
- typedef pascal void (*IPMNoteProcPtr)(
- IPMQueueRef queue, IPMSeqNum seqNum, IPMNotificationType notificationType,
- unsigned long userData);
-
-
- struct IPMFixedHdrInfo {
- unsigned short version;
- Boolean authenticated;
- Boolean signatureEnclosed; /* digital signature enclosed */
- unsigned long msgSize;
- IPMNotificationType notification;
- IPMPriority priority;
- unsigned short blockCount;
- unsigned short originalRcptCount; /* original number of recipients */
- unsigned long refCon; /* Client defined data */
- unsigned short reserved;
- UTCTime creationTime; /* Time when it was created */
- IPMMsgID msgID;
- OSType family; /* family this msg belongs (e.g. mail) */
- };
-
- typedef struct IPMFixedHdrInfo IPMFixedHdrInfo;
-
- enum {
- kIPMDeliveryNotificationBit = 0,
- kIPMNonDeliveryNotificationBit = 1,
- kIPMEncloseOriginalBit = 2,
- kIPMSummaryReportBit = 3,
- kIPMOriginalOnlyOnErrorBit = 4 /* modify enclose original to only on error */
- };
-
- enum {
- kIPMNoNotificationMask = 0x00,
- kIPMDeliveryNotificationMask = 1<<kIPMDeliveryNotificationBit,
- kIPMNonDeliveryNotificationMask = 1<<kIPMNonDeliveryNotificationBit,
- kIPMDontEncloseOriginalMask = 0x00,
- kIPMEncloseOriginalMask = 1<<kIPMEncloseOriginalBit,
- kIPMImmediateReportMask = 0x00,
- kIPMSummaryReportMask = 1<<kIPMSummaryReportBit,
- kIPMOriginalOnlyOnErrorMask = 1<<kIPMOriginalOnlyOnErrorBit,
- kIPMEncloseOriginalOnErrorMask = (kIPMOriginalOnlyOnErrorMask|kIPMEncloseOriginalMask)
- };
-
- /* standard Non delivery codes */
- enum {
- kIPMNoSuchRecipient = 0x0001,
- kIPMRecipientMalformed = 0x0002,
- kIPMRecipientAmbiguous = 0x0003,
- kIPMRecipientAccessDenied = 0x0004,
- kIPMGroupExpansionProblem = 0x0005,
- kIPMMsgUnreadable = 0x0006,
- kIPMMsgExpired = 0x0007,
- kIPMMsgNoTranslatableContent = 0x0008,
- kIPMRecipientReqStdCont = 0x0009,
- kIPMRecipientReqSnapShot = 0x000A,
- kIPMNoTransferDiskFull = 0x000B,
- kIPMNoTransferMsgRejectedbyDest = 0x000C,
- kIPMNoTransferMsgTooLarge = 0x000D
- };
-
- /*************************************************************************/
- /*
- This is the structure that will be returned by enumerate and getmsginfo
- This definition is just to give you a template, the position of msgType
- is variable since this is a packed structure. procHint and msgType are
- packed and even length padded.
- */
- struct IPMMsgInfo { /* master message info */
- IPMSeqNum sequenceNum;
-
- unsigned long userData;
- unsigned short respIndex;
- Byte padByte;
- IPMPriority priority;
- unsigned long msgSize;
- unsigned short originalRcptCount;
- unsigned short reserved;
- UTCTime creationTime;
- IPMMsgID msgID;
- OSType family; /* family this msg belongs (e.g. mail) */
- IPMProcHint procHint;
- IPMMsgType msgType;
- };
-
- typedef struct IPMMsgInfo IPMMsgInfo;
-
- typedef OCECreatorType IPMBlockType;
-
- struct IPMTOC {
- IPMBlockType blockType;
- long blockOffset;
- unsigned long blockSize;
- unsigned long blockRefCon;
- };
-
- typedef struct IPMTOC IPMTOC;
-
-
- /*
- The following structure is just to describe the layout of the SingleFilter.
- Each field should be packed and word aligned when passed to the IPM ToolBox.
- */
-
- struct IPMSingleFilter {
- IPMPriority priority;
- Byte padByte;
- OSType family; /* family this msg belongs (e.g. mail), '????' for all */
- ScriptCode script; /* Language Identifier */
- IPMProcHint hint;
- IPMMsgType msgType;
- };
-
- typedef struct IPMSingleFilter IPMSingleFilter;
-
- struct IPMFilter {
- unsigned short count;
- IPMSingleFilter sFilters[1];
- };
-
- typedef struct IPMFilter IPMFilter;
-
- /*************************************************************************/
- /*
- Following structures define the “start” of a recipient report block and the
- elements of the array respectively.
- */
-
- struct IPMReportBlockHeader {
- IPMMsgID msgID; /* message id of the original */
- UTCTime creationTime; /* creation time of the report */
- };
-
- typedef struct IPMReportBlockHeader IPMReportBlockHeader;
-
- struct OCERecipientReport {
- unsigned short rcptIndex; /* index of recipient in original message */
- OSErr result; /* result of sending letter to this recipient*/
- };
-
- typedef struct OCERecipientReport OCERecipientReport;
- /*************************************************************************/
-
-
- #define IPMParamHeader \
- Ptr qLink; \
- long reservedH1; \
- long reservedH2; \
- ProcPtr ioCompletion; \
- OSErr ioResult; \
- long saveA5; \
- short reqCode;
-
-
- struct IPMOpenContextPB {
- IPMParamHeader
- IPMContextRef contextRef; /* <-- Context reference to be used in further calls*/
- };
-
- typedef struct IPMOpenContextPB IPMOpenContextPB;
- typedef IPMOpenContextPB IPMCloseContextPB;
-
-
- struct IPMCreateQueuePB {
- IPMParamHeader
- long filler1;
- OCERecipient* queue;
- AuthIdentity identity; /* used only if queue is remote */
- PackedRecordID* owner; /* used only if queue is remote */
- };
-
- typedef struct IPMCreateQueuePB IPMCreateQueuePB;
- /* For createqueue and deletequeue only queue and identity are used */
- typedef IPMCreateQueuePB IPMDeleteQueuePB;
-
-
- struct IPMOpenQueuePB {
- IPMParamHeader
- IPMContextRef contextRef;
- OCERecipient* queue;
- AuthIdentity identity;
- IPMFilter* filter;
- IPMQueueRef newQueueRef;
- IPMNoteProcPtr notificationProc;
- unsigned long userData;
- IPMNotificationType noteType;
- Byte padByte;
- long reserved;
- long reserved2;
- };
-
- typedef struct IPMOpenQueuePB IPMOpenQueuePB;
-
- struct IPMCloseQueuePB {
- IPMParamHeader
- IPMQueueRef queueRef;
- };
-
- typedef struct IPMCloseQueuePB IPMCloseQueuePB;
-
- struct IPMEnumerateQueuePB {
- IPMParamHeader
- IPMQueueRef queueRef;
- IPMSeqNum startSeqNum;
- Boolean getProcHint;
- Boolean getMsgType;
- short filler;
- IPMFilter* filter;
- unsigned short numToGet;
- unsigned short numGotten;
- unsigned long enumCount;
- Ptr enumBuffer; /* will be packed array of IPMMsgInfo */
- unsigned long actEnumCount;
- };
-
- typedef struct IPMEnumerateQueuePB IPMEnumerateQueuePB;
- typedef IPMEnumerateQueuePB IPMChangeQueueFilterPB;
-
-
- struct IPMDeleteMsgRangePB {
- IPMParamHeader
- IPMQueueRef queueRef;
- IPMSeqNum startSeqNum;
- IPMSeqNum endSeqNum;
- IPMSeqNum lastSeqNum;
- };
-
- typedef struct IPMDeleteMsgRangePB IPMDeleteMsgRangePB;
-
-
- struct IPMOpenMsgPB {
- IPMParamHeader
- IPMQueueRef queueRef;
- IPMSeqNum sequenceNum;
- IPMMsgRef newMsgRef;
- IPMSeqNum actualSeqNum;
- Boolean exactMatch;
- Byte padByte;
- long reserved;
- };
-
- typedef struct IPMOpenMsgPB IPMOpenMsgPB;
-
-
- struct IPMOpenHFSMsgPB {
- IPMParamHeader
- FSSpec* hfsPath;
- long filler;
- IPMMsgRef newMsgRef;
- long filler2;
- Byte filler3;
- long reserved;
- };
-
- typedef struct IPMOpenHFSMsgPB IPMOpenHFSMsgPB;
-
-
- struct IPMOpenBlockAsMsgPB {
- IPMParamHeader
- IPMMsgRef msgRef;
- unsigned long filler;
- IPMMsgRef newMsgRef;
- unsigned short filler2[7];
- unsigned short blockIndex;
- };
-
- typedef struct IPMOpenBlockAsMsgPB IPMOpenBlockAsMsgPB;
-
-
- struct IPMCloseMsgPB {
- IPMParamHeader
- IPMMsgRef msgRef;
- Boolean deleteMsg;
- };
-
- typedef struct IPMCloseMsgPB IPMCloseMsgPB;
-
-
- struct IPMGetMsgInfoPB {
- IPMParamHeader
- IPMMsgRef msgRef;
- IPMMsgInfo* info;
- };
-
- typedef struct IPMGetMsgInfoPB IPMGetMsgInfoPB;
-
-
- struct IPMReadHeaderPB {
- IPMParamHeader
- IPMMsgRef msgRef;
- unsigned short fieldSelector;
- long offset;
- unsigned long count;
- Ptr buffer;
- unsigned long actualCount;
- unsigned short filler;
- unsigned long remaining;
- };
-
- typedef struct IPMReadHeaderPB IPMReadHeaderPB;
-
-
- struct IPMReadRecipientPB {
- IPMParamHeader
- IPMMsgRef msgRef;
- unsigned short rcptIndex;
- long offset;
- unsigned long count;
- Ptr buffer;
- unsigned long actualCount;
- short reserved; /* must be zero */
- unsigned long remaining;
- unsigned short originalIndex;
- OCERecipientOffsetFlags recipientOffsetFlags;
- };
-
- typedef struct IPMReadRecipientPB IPMReadRecipientPB;
-
-
- /*
- replyQueue works like recipient. [can no longer read it via ReadHeader]
- OriginalIndex is meaningless, rcptFlags are used seperately and there are
- currently none defined.
- */
- typedef IPMReadRecipientPB IPMReadReplyQueuePB;
-
-
- struct IPMGetBlkIndexPB {
- IPMParamHeader
- IPMMsgRef msgRef;
- IPMBlockType blockType;
- unsigned short index;
- unsigned short startingFrom;
- IPMBlockType actualBlockType;
- unsigned short actualBlockIndex;
- };
-
- typedef struct IPMGetBlkIndexPB IPMGetBlkIndexPB;
-
-
- struct IPMReadMsgPB {
- IPMParamHeader
- IPMMsgRef msgRef;
- IPMAccessMode mode;
- long offset;
- unsigned long count;
- Ptr buffer;
- unsigned long actualCount;
- unsigned short blockIndex;
- unsigned long remaining;
- };
-
- typedef struct IPMReadMsgPB IPMReadMsgPB;
-
- struct IPMVerifySignaturePB {
- IPMParamHeader
- IPMMsgRef msgRef;
- SIGContextPtr signatureContext;
- };
-
- typedef struct IPMVerifySignaturePB IPMVerifySignaturePB;
-
- struct IPMNewMsgPB {
- IPMParamHeader
- unsigned long filler;
- OCERecipient* recipient;
- OCERecipient* replyQueue;
- StringPtr procHint;
- unsigned short filler2;
- IPMMsgType* msgType;
- unsigned long refCon;
- IPMMsgRef newMsgRef;
- unsigned short filler3;
- long filler4;
- AuthIdentity identity;
- IPMSender* sender;
- unsigned long internalUse;
- unsigned long internalUse2;
- };
-
- typedef struct IPMNewMsgPB IPMNewMsgPB;
-
- struct IPMNewHFSMsgPB {
- IPMParamHeader
- FSSpec* hfsPath;
- OCERecipient* recipient;
- OCERecipient* replyQueue;
- StringPtr procHint;
- unsigned short filler2;
- IPMMsgType* msgType;
- unsigned long refCon;
- IPMMsgRef newMsgRef;
- unsigned short filler3;
- long filler4;
- AuthIdentity identity;
- IPMSender* sender;
- unsigned long internalUse;
- unsigned long internalUse2;
- };
-
- typedef struct IPMNewHFSMsgPB IPMNewHFSMsgPB;
-
- struct IPMNestMsgPB {
- IPMParamHeader
- IPMMsgRef msgRef;
- unsigned short filler[9];
- unsigned long refCon;
- IPMMsgRef msgToNest;
- unsigned short filler2;
- long startingOffset;
- };
-
- typedef struct IPMNestMsgPB IPMNestMsgPB;
-
-
- struct IPMNewNestedMsgBlockPB {
- IPMParamHeader
- IPMMsgRef msgRef;
- OCERecipient* recipient;
- OCERecipient* replyQueue;
- StringPtr procHint;
- unsigned short filler1;
- IPMMsgType* msgType;
- unsigned long refCon;
- IPMMsgRef newMsgRef;
- unsigned short filler2;
- long startingOffset;
- AuthIdentity identity;
- IPMSender* sender;
- unsigned long internalUse;
- unsigned long internalUse2;
- };
-
- typedef struct IPMNewNestedMsgBlockPB IPMNewNestedMsgBlockPB;
-
-
- struct IPMEndMsgPB {
- IPMParamHeader
- IPMMsgRef msgRef;
- IPMMsgID msgID;
- RString* msgTitle;
- IPMNotificationType deliveryNotification;
- IPMPriority priority;
- Boolean cancel;
- Byte padByte;
- long reserved;
- SIGSignaturePtr signature;
- Size signatureSize;
- SIGContextPtr signatureContext;
- OSType family; /* family this msg belongs (e.g. mail) */
- /* use kIPMFamilyUnspecified by default */
- };
-
- typedef struct IPMEndMsgPB IPMEndMsgPB;
-
-
- typedef struct IPMAddRecipientPB {
- IPMParamHeader
- IPMMsgRef msgRef;
- OCERecipient* recipient;
- long reserved;
- };
-
- typedef struct IPMAddRecipientPB IPMAddRecipientPB;
-
-
- struct IPMAddReplyQueuePB {
- IPMParamHeader
- IPMMsgRef msgRef;
- long filler;
- OCERecipient* replyQueue;
- };
-
- typedef struct IPMAddReplyQueuePB IPMAddReplyQueuePB;
-
-
- struct IPMNewBlockPB {
- IPMParamHeader
- IPMMsgRef msgRef;
- IPMBlockType blockType;
- unsigned short filler[5];
- unsigned long refCon;
- unsigned short filler2[3];
- long startingOffset;
- };
-
- typedef struct IPMNewBlockPB IPMNewBlockPB;
-
-
- struct IPMWriteMsgPB {
- IPMParamHeader
- IPMMsgRef msgRef;
- IPMAccessMode mode;
- long offset;
- unsigned long count;
- Ptr buffer;
- unsigned long actualCount;
- Boolean currentBlock;
- };
-
- typedef struct IPMWriteMsgPB IPMWriteMsgPB;
-
-
-
-
- union IPMParamBlock {
- struct {IPMParamHeader} header;
- IPMOpenContextPB openContextPB;
- IPMCloseContextPB closeContextPB;
- IPMCreateQueuePB createQueuePB;
- IPMDeleteQueuePB deleteQueuePB;
- IPMOpenQueuePB openQueuePB;
- IPMCloseQueuePB closeQueuePB;
- IPMEnumerateQueuePB enumerateQueuePB;
- IPMChangeQueueFilterPB changeQueueFilterPB;
- IPMDeleteMsgRangePB deleteMsgRangePB;
- IPMOpenMsgPB openMsgPB;
- IPMOpenHFSMsgPB openHFSMsgPB;
- IPMOpenBlockAsMsgPB openBlockAsMsgPB;
- IPMCloseMsgPB closeMsgPB;
- IPMGetMsgInfoPB getMsgInfoPB;
- IPMReadHeaderPB readHeaderPB;
- IPMReadRecipientPB readRecipientPB;
- IPMReadReplyQueuePB readReplyQueuePB;
- IPMGetBlkIndexPB getBlkIndexPB;
- IPMReadMsgPB readMsgPB;
- IPMVerifySignaturePB verifySignaturePB;
- IPMNewMsgPB newMsgPB;
- IPMNewHFSMsgPB newHFSMsgPB;
- IPMNestMsgPB nestMsgPB;
- IPMNewNestedMsgBlockPB newNestedMsgBlockPB;
- IPMEndMsgPB endMsgPB;
- IPMAddRecipientPB addRecipientPB;
- IPMAddReplyQueuePB addReplyQueuePB;
- IPMNewBlockPB newBlockPB;
- IPMWriteMsgPB writeMsgPB;
- };
-
- typedef union IPMParamBlock IPMParamBlock;
- typedef IPMParamBlock *IPMParamBlockPtr;
-
- /* Request codes */
- #define kIPMOpenContext 0x400
- #define kIPMCloseContext 0x401
- #define kIPMNewMsg 0x402
- #define kIPMAddRecipient 0x403
- #define kIPMNewBlock 0x404
- #define kIPMNewNestedMsgBlock 0x405
- #define kIPMNestMsg 0x406
- #define kIPMWriteMsg 0x407
- #define kIPMEndMsg 0x408
- #define kIPMOpenQueue 0x409
- #define kIPMCloseQueue 0x40A
- #define kIPMOpenMsg 0x40B
- #define kIPMCloseMsg 0x40C
- #define kIPMReadMsg 0x40D
- #define kIPMReadHeader 0x40E
- #define kIPMOpenBlockAsMsg 0x40F
- #define kIPMReadRecipient 0x410
- #define kIPMCreateQueue 0x411
- #define kIPMDeleteQueue 0x412
- #define kIPMEnumerateQueue 0x413
- #define kIPMChangeQueueFilter 0x414
- #define kIPMDeleteMsgRange 0x415
- #define kIPMOpenHFSMsg 0x417
- #define kIPMGetBlkIndex 0x418
- #define kIPMGetMsgInfo 0x419
-
- #define kIPMAddReplyQueue 0x41D
- #define kIPMNewHFSMsg 0x41E
-
- #define kIPMReadReplyQueue 0x421
- #define kIPMVerifySignature 0x422
-
-
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- pascal OSErr IPMOpenContext(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMOpenContext, _oceTBDispatch};
-
- pascal OSErr IPMCloseContext(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMCloseContext, _oceTBDispatch};
-
- pascal OSErr IPMNewMsg(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMNewMsg, _oceTBDispatch};
-
- pascal OSErr IPMNewBlock(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMNewBlock, _oceTBDispatch};
-
- pascal OSErr IPMNewNestedMsgBlock(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMNewNestedMsgBlock, _oceTBDispatch};
-
- pascal OSErr IPMNestMsg(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMNestMsg, _oceTBDispatch};
-
- pascal OSErr IPMWriteMsg(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMWriteMsg, _oceTBDispatch};
-
- pascal OSErr IPMEndMsg(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMEndMsg, _oceTBDispatch};
-
- pascal OSErr IPMOpenQueue(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMOpenQueue, _oceTBDispatch};
-
- pascal OSErr IPMCloseQueue(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMCloseQueue, _oceTBDispatch};
-
- pascal OSErr IPMVerifySignature(IPMParamBlockPtr paramBlock) /* Always synchronous */
- = {0x7000, 0x1f00, 0x3F3C, kIPMVerifySignature, _oceTBDispatch};
-
- pascal OSErr IPMOpenMsg(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMOpenMsg, _oceTBDispatch};
-
- pascal OSErr IPMCloseMsg(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMCloseMsg, _oceTBDispatch};
-
- pascal OSErr IPMReadMsg(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMReadMsg, _oceTBDispatch};
-
- pascal OSErr IPMReadHeader(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMReadHeader, _oceTBDispatch};
-
- pascal OSErr IPMOpenBlockAsMsg(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMOpenBlockAsMsg, _oceTBDispatch};
-
- pascal OSErr IPMNewHFSMsg(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMNewHFSMsg, _oceTBDispatch};
-
- pascal OSErr IPMReadRecipient(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMReadRecipient, _oceTBDispatch};
-
- pascal OSErr IPMReadReplyQueue(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMReadReplyQueue, _oceTBDispatch};
-
- pascal OSErr IPMCreateQueue(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMCreateQueue, _oceTBDispatch};
-
- pascal OSErr IPMDeleteQueue(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMDeleteQueue, _oceTBDispatch};
-
- pascal OSErr IPMEnumerateQueue(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMEnumerateQueue, _oceTBDispatch};
-
- pascal OSErr IPMChangeQueueFilter(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMChangeQueueFilter, _oceTBDispatch};
-
- pascal OSErr IPMDeleteMsgRange(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMDeleteMsgRange, _oceTBDispatch};
-
- pascal OSErr IPMAddRecipient(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMAddRecipient, _oceTBDispatch};
-
- pascal OSErr IPMAddReplyQueue(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMAddReplyQueue, _oceTBDispatch};
-
- pascal OSErr IPMOpenHFSMsg(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMOpenHFSMsg, _oceTBDispatch};
-
- pascal OSErr IPMGetBlkIndex(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMGetBlkIndex, _oceTBDispatch};
-
- pascal OSErr IPMGetMsgInfo(IPMParamBlockPtr paramBlock, Boolean async)
- = {0x3F3C, kIPMGetMsgInfo, _oceTBDispatch};
-
-
- #ifdef __cplusplus
- };
- #endif
-
-
-
-
- /****************************************************************************************/
- /* EXTERNAL ROUTINES */
-
- #ifndef __OCEMessaging
- #define __OCEMessaging(selector) = { 0x303C, selector, 0xAA5C}
- #endif
-
- #define kOCESizePackedRecipient 830
- #define kOCEPackRecipient 831
- #define kOCEUnpackRecipient 832
- #define kOCEStreamRecipient 833
- #define kOCEGetRecipientType 834
- #define kOCESetRecipientType 835
-
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /*
- Compute the space that a OCERecipient would take if it were in packed
- form. [Note: does NOT even pad extensionSize, so you may get an odd #back out]
- Safe to pass dereferenced handle(s).
- */
-
- pascal unsigned short OCESizePackedRecipient(const OCERecipient *rcpt)
- __OCEMessaging(kOCESizePackedRecipient);
-
-
- /*
- Take an OCERecipient (scatter) and (gather) stream into the specified
- buffer. It is assumed that there is sufficient space in the buffer (that is
- OCESizePackedRecipient). Safe to pass dereferenced handle(s).
- */
- pascal unsigned short OCEPackRecipient(const OCERecipient *rcpt, void* buffer)
- __OCEMessaging(kOCEPackRecipient);
-
- /*
- Take a packed OCERecipient and cast a the OCERecipient frame over it. Returns
- amBadDestId if it doesn't look like an OCERecipient. Safe to pass dereferenced
- handle(s).
- */
- pascal OSErr OCEUnpackRecipient(const void* buffer, OCERecipient *rcpt,
- RecordID *entitySpecifier)
- __OCEMessaging(kOCEUnpackRecipient);
-
-
- /*
- Take an OCERecipient (scatter) and (gather) stream using the specified
- function. Safe to pass dereferenced handle(s). If streamer function returns
- OCEError OCEStreamRecipient stops execution and passes the error back to the caller
- */
- typedef pascal OSErr (*OCERecipientStreamer)(
- void* buffer, unsigned long count, Boolean eof, long userData);
-
- pascal OSErr OCEStreamRecipient(const OCERecipient* rcpt, OCERecipientStreamer stream,
- long userData, unsigned long* actualCount)
- __OCEMessaging(kOCEStreamRecipient);
-
-
- /* Get the OCERecipient's extensionType. Safe to pass dereferenced handle(s).*/
-
- pascal OSType OCEGetRecipientType(const CreationID *cid)
- __OCEMessaging(kOCEGetRecipientType);
-
-
- /*
- Set the OCERecipient's extensionType in the specified cid. (Note: we do NOT
- check for a nil pointer). If the extensionType is 'entn', the cid is assumed
- to be "valid" and is not touched. Note: to properly handle non 'entn''s this
- routine must and will zero the high long (source) of the cid! Safe to pass
- dereferenced handle(s).
- */
- pascal void OCESetRecipientType(OSType extensionType, CreationID *cid)
- __OCEMessaging(kOCESetRecipientType);
-
-
- #ifdef __cplusplus
- };
- #endif
-
-
- #endif
-